#include <stdio.h>
#include <string.h>

int main(){
	int hefa,shuzi,zimu,n,k;
	char str[81],s;
	scanf("%d",&n);getchar();
	for( int i=0; i<n; i++ ){
		hefa=1;shuzi=0;zimu=0;k=0;
		while( (s=getchar())!='\n' ){
			str[k++]=s;
		}
		str[k]=NULL;//scanf("%s",&str);
		if( strlen(str)<6 ){
			printf("Your password is tai duan le.\n");
		}else{
			for( int j=0; j<strlen(str); j++ ){
				if( (str[j]>='a'&&str[j]<='z')||(str[j]>='A'&&str[j]<='Z') ){
					zimu=1;
				}else if( str[j]>='0'&&str[j]<='9' ){
					shuzi=1;
				}else if( str[j]=='.' ){
				}else{
					printf("Your password is tai luan le.\n");hefa=0;break;
				}
			}
			if( hefa==1 ){
				if( shuzi==1&&zimu==1 ){
					printf("Your password is wan mei.\n");
				}else if(zimu==0 ){
					printf("Your password needs zi mu.\n");
				}else{
					printf("Your password needs shu zi.\n");
				}
			} 
		}
	}
	return 0;
} 
